package com.commit.mapper;

import com.commit.domain.Answer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author:zyh
 * @Time:2021-02-28-12:13
 * @email:1269231889@qq.com
 */
@Mapper
public interface AnswerMapper {
    //根据问题id获取回复记录
    List<Answer> findByQuesId(Integer quesId);

    //保存回复
    void saveAns(Answer ans);

    Answer findOne(Integer id);

    //根据问题id删除所有回复
    void deleteByQuestionId(Integer quesId);

    //更新回答
    void update(Answer answer);


    Answer selectOneByAnsId(Integer id);

    //展示一个问题下的所有回答
    List<Answer> findByQuestion(@Param("title") String title);

    //展示采纳回答
    Answer isAccept(@Param("title") String title);

    //展示高赞回答
    List<Answer> highLikes(@Param("title") String title);
}
